Change templating support to new system#7536
Conversation
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern | ||
| $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern | ||
| $jsonTemplateFiles | ForEach-Object { | ||
| $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json |
There was a problem hiding this comment.
it's a powershell-ism. disposes the created variable :)
| $jsonFiles = @() | ||
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\en\..+\.json" } # .NET templating pattern | ||
| $jsonFiles += Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern | ||
| $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern |
There was a problem hiding this comment.
non actionable: i just noticed that stub files create in our repo are .templatestrings.json instead of templatestrings..json
That's probably what made dotnet/templating#3296 messy:

There was a problem hiding this comment.
precisely! @bekir-ozturk and I have talked about renaming the templates so onelocbuild supports them, and this work makes sure the names are handled properly when they get pushed in.
|
@jonfortescue just to double check: are you expecting repos with templates to provide files for all languages or only english? why do you need to copy the file en.templatestrings.json as templatestrings.json without lang code? |
|
@vlada-shubina the en is the base file from which translations are created; all languages end up being returned but only one file needs to be submitted. |
Closes dotnet/core-eng#13399.
dotnet/templating has a new format for templates (per our request actually!). This adds support for it. Test build here showing it works as a proof of concept.
To double check: